# Contributor: Johannes Matheis <jomat+alpinebuild@jmt.gr>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=jq
pkgver=1.7.1
pkgrel=0
pkgdesc="A lightweight and flexible command-line JSON processor"
url="https://jqlang.github.io/jq/"
arch="all"
license="MIT"
makedepends="oniguruma-dev"
subpackages="$pkgname-doc $pkgname-dev"
source="jq-$pkgver.tar.gz::https://github.com/jqlang/jq/releases/download/jq-$pkgver/jq-$pkgver.tar.gz"

# secfixes:
#   1.6_rc1-r0:
#     - CVE-2016-4074

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--disable-docs
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" prefix=/usr install
}

sha512sums="
464861fb2e0d6934b616f1dc7f8002d7dae727c8c0c07b385b813e7522ba1ada8ead4165e1d99c892e3ea76e238c55a15b718c738805419721920f88f8d8478c  jq-1.7.1.tar.gz
"
